<?php ?> 

 <div class="row-fluid">
 <?php echo validation_errors(); ?>
 <form method="post" action="<?= site_url('admin/create_case');?>">
     <div class="span4">
        <legend>CUSTOMER INFORMATION</legend>
		<label> Case No.</label>
		<input type="text" value="" class="span4" name="case_id">
        <label>Company Name:</label>
		<input type="text" placeholder="Customer Company Name" name="company_name" id="companyName"/>
		<label>Contact Person</label>
		<input type="text" placeholder="Contact person Name" name="contact_person" id="contactPerson"/>
		<label> Address </label>
		<textarea rows="2" name="address" id="address"></textarea>
		<label>PIN Code</label>
		<input type="text" placeholder="EnterPIN Code" name="pin_code" id="pinCode"/>
		<label>Landline Number</label>
		<input type="text" placeholder="Enter Landline No." name="landline_no" id="landlineNo"/>
		<label>Mobile No.</label>
		<input type="text" placeholder="Enter Mobile No." name="mobile_no" id="mobileNo"/>
		<label>Email-ID </label>
		<input type="text" placeholder="Enter Email-ID" name="email_id" id="emailId"/>
      </div>
	  <div class="span4">
        <legend>INFORMATION BY ENGINEER</legend>
        <label>Model No.</label>
		<input type="text" placeholder="Enter Model No." name="model_no" id="modelNo"/>
		 <label>Product No.</label>
		<input type="text" placeholder="Enter Product No." name="product_no" id="productNo"/>
		 <label>Serial No.</label>
		<input type="text" placeholder="Enter Serial No." name="serial_no" id="serialNo"/>
		 <label>Password</label>
		<input type="text" placeholder="Enter Password" name="password" id="password"/>
		 <label>Operating System</label>
		<input type="text" placeholder="Enter Operating System " name="operating_system" id="operatingSystem"/>
		 <label>Country Of Purchase</label>
		 <select name="country_purchase" id="countryPurchase">
			 <?php foreach($country as $row){ 
             echo "<option value=$row->id>$row->name; </option>";}?>
           </select> 
	  <label> Issue Reported</label>
	  <textarea rows="2" name="issue_reported" id="issueReported"></textarea>
	  <label> Demo Engineer Diagnosis</label>
	  	<textarea rows="2" name="demo_diagnosis" id="diagnosis"></textarea>
      </div>
	  <div class="span4">
        <legend>CUSTOMER ACCESSORIES</legend>
		<div class="span5"><h4> Items </h4><hr></div><div class="span6"><h4>Description</h4><hr></div>
		 <div class="span5"><label class="checkbox"><input type="checkbox" value="Yes"name="chk_adapter" id="chkadapter"/> AC Adapter</label></div>
		 <div class="span6"><input type="text" placeholder="Enter AC Adapter Details" id="adapter" name="adapter"/></div>
		 <div class="span5"><label class="checkbox"><input type="checkbox" value="Yes"name="chk_driver" id="chkdriver"/> Driver CD</label></div>
		 <div class="span6"><input type="text" placeholder="Enter DRIVER CD Details" id="drivercd" name="drivercd"/></div>
		 <div class="span5"><label class="checkbox"><input type="checkbox" value="Yes"name="chk_bag" id="chkbag"/> Bag</label></div>
		 <div class="span6"><input type="text" placeholder="Enter Bag Details" id="bag" name="bag"/></div>
		 <div class="span5"><label class="checkbox"><input type="checkbox" value="Yes"name="chk_hdd" id="chkhdd"/> HDD</label></div>
		 <div class="span6"><input type="text" placeholder="Enter HDD Details" id="hdd" name="hdd"/></div>
		 <div class="span5"><label class="checkbox"><input type="checkbox" value="Yes"name="chk_powercord" id="chkpowercord"/> Power Cord</label></div>
		 <div class="span6"><input type="text" placeholder="Enter Power Cord Details" id="power_cord" name="powerCord"/></div>
		 <div class="span5"><label class="checkbox"><input type="checkbox" value="Yes"name="chk_carry" id="chkcarry"/>Carry Case Belt</label></div>
		 <div class="span6"><input type="text" placeholder="Enter Carry Case Bag Details" id="carry_case" name="carryCase"/></div>
		  <div class="span5"><label class="checkbox"><input type="checkbox" value="Yes"name="chk_optical" id="chkoptical"/>Optical Drive</label></div>
		 <div class="span6"><input type="text" placeholder="Enter Optical Drive Details" id="optical_drive" name="opticalDrive"/></div>
		 <div class="span5"><label class="checkbox"><input type="checkbox" value="Yes" name="chk_fax" id="chkfax"/>Fax Modem Card</label></div>
		 <div class="span6"><input type="text" placeholder="Enter Fax Modem Details" id="fax_modem" name="faxModem"/></div>
		 <div class="span5"><label class="checkbox"><input type="checkbox" value="Yes"name="chk_network" id="chknetwork"/>Network Card</label></div>
		 <div class="span6"><input type="text" placeholder="Enter Network Details" id="network_card" name="networkCard"/></div>
		 <div class="span5"><label class="checkbox"><input type="checkbox" value="Yes"name="chk_memory" id="chkmemory"/>Memory</label></div>
		 <div class="span6"><input type="text" placeholder="Enter Memory Details" id="memory" name="memory"/></div>
		 <div class="span5"><label class="checkbox"><input type="checkbox" value="Yes"name="chk_capacity" id="chkcapacity"/>Capacity</label></div>
		 <div class="span6"><input type="text" placeholder="Enter Capacity Details" id="capacity" name="capacity"/></div>
		 <div class="span5"><label class="checkbox"><input type="checkbox" value="Yes"name="chk_tray" id="chktray"/>Tray</label></div>
		 <div class="span6"><input type="text" placeholder="Enter Tray Details" id="tray" name="tray"/></div>
		 <div class="span5"><label class="checkbox"><input type="checkbox" value="Yes"name="chk_battery" id="chkbattery"/>Battery</label></div>
		 <div class="span6"><input type="text" placeholder="Enter Battery SL. NO." id="battery" name="battery"/></div>
		 <div class="span5"><label class="checkbox"><input type="checkbox" value="Yes"name="chk_cradle" id="chkcradle"/>Cradle</label></div>
		 <div class="span6"><input type="text" placeholder="Enter Cradle Details" id="cradle" name="cradle"/></div>
		 <div class="span5"><label class="checkbox"><input type="checkbox" value="Yes"name="chk_fdd" id="chkfdd"/>FDD</label></div>
		 <div class="span6"><input type="text" placeholder="Enter FDD Details" id="fdd" name="fdd"/></div>
		 <div class="span5"><label class="checkbox"><input type="checkbox" value="Yes"name="chk_itb" id="chkitb"/>ITB</label></div>
		 <div class="span6"><input type="text" placeholder="Enter ITB Details" id="itb" name="itb"/></div>
		 <div class="span5"><label class="checkbox"><input type="checkbox" value="Yes"name="chk_wireless" id="chkwireless"/>Wireless LAN</label></div>
		 <div class="span6"><input type="text" placeholder="Enter Wireless LAN Details" id="wireless" name="wireless"/></div>
		 </div>
		 </div>	
         <div class="span5"></div><div class="span4"><input type="submit" class="btn btn-inverse" value="Submit" id="caseSubmit"/></form>	</div>	 
		 
		 
		 
		 
		 
		 
		 
<script>
		 $('#caseSubmit').click(function () {	
	  if(!$('#company_name').val())
	 {
	alert('Company Name Feild is Required');	
		$('#company_name').focus();
	}
	else if(!$('#contact_person').val())
	{
	alert('Contact Person Field is Required');	
		$('#contact_person').focus();
	}
	else if(!$('#address').val())
	{
	alert('Address Feild is Required');	
		$('#address').focus();
	}
	else if(!$('#pin_code').val())
	{
	alert('Pin Code Feild is Required');	
		$('#pin_code').focus();
	}
	else if(!$('#landline_no').val())
	{
	alert('Landline No. Feild is Required');	
	$('#landline_no').focus();
	}
	else if(!$('#mobile_no').val())
	{
	alert('Mobile No  Feild is Required');	
		$('#mobile_no').focus();
	}
	else if(!$('#email_id').val())
	{
	alert('Email-id Feild is Required');	
		$('#email_id').focus();
	}
	else if(!$('#model_no').val())
	{
	alert('Model No Feild is Required');	
		$('#model_no').focus();
	}
	else if(!$('#product_no').val())
	{
	alert('Product No Feild is Required');	
		$('#product_no').focus();
	}
	else if(!$('#serial_no').val())
	{
	alert('Serial No. Feild is Required');	
		$('#serial_no').focus();
	}
	else if(!$('#password').val())
	{
	alert('Password Feild is Required');	
		$('#password').focus();
	}
	else if(!$('#operating_system').val())
	{
	alert('Operating System Feild is Required');	
		$('#operating_system').focus();
	}
	else if(!$('#country_purchase').val())
	{
	alert('Country Feild is Required');	
		$('#country_purchase').focus();
	}
	else if(!$('#issue_reported').val())
	{
	alert('Issue Reported Feild is Required');	
		$('#issue_reported').focus();
	}
	else if(!$('#demo_diagnosis').val())
	{
	alert('Demo Diagnosis Feild is Required');	
		$('#demo_diagnosis').focus();
	}
	else {
	var company_name=$('#company_name').val();
	var contact_person=$('#contact_person').val();
	var address=$('#address').val();
	var pin_code=$('#pin_code').val();
	var landline_no=$('#landline_no').val();
	var mobile_no=$('#mobile_no').val();
	var email_id=$('#email_id').val();
	var model_no=$('#model_no').val();
	var product_no=$('#product_no').val();
	var serial_no=$('#serial_no').val();
	var password=$('#password').val();
	var operating_system =$('#operating_system').val();
	var country_purchase=$('#country_purchase').val();
	var issue_reported=$('#issue_reported').val();
	var demo_diagnosis=$('#demo_diagnosis').val();
	if($('#chk_adapter').checked)
	{
	var adapter=$('#chk_adapter').val();
	}
	else
	{
	var adapter="";
	}
	var driver=$('#chk_driver').val();
	var bag=$('#chk_bag').val();
	var hdd=$('#chk_hdd').val();
	var power=$('#chk_powercord').val();
	var carry=$('#chk_carry').val();
	var optical=$('#chk_optical').val();
	var fax=$('#chk_fax').val();
	var network=$('#chk_network').val();
	var memory=$('#chk_memory').val();
	var capacity=$('#chk_capacity').val();
	var tray=$('#chk_tray').val();
	var battery=$('#chk_battery').val();
	var cradle=$('#chk_cradle').val();
	var fdd=$('#chk_fdd').val();
	var itb=$('#chk_itb').val();
	var wireless=$('#chk_wireless').val();
  $.post('<?= site_url('case_id/create_case');?>',
  {company_name : company_name , contact_person : contact_person ,address:address, pin_code : pin_code,landline_no : landline_no,mobile_no:mobile_no,email_id:email_id,model_no:model_no,product_no:product_no,serial_no:serial_no,password:password,operating_system:operating_system,country_purchase:country_purchase,issue_reported:issue_reported,demo_diagnosis:demo_diagnosis,adapter:adapter,driver:driver,bag:bag,hdd:hdd,power:power,carry:carry,optical:optical,fax:fax,network:network,memory:memory,capacity:capacity,tray:tray,battery:battery,cradle:cradle,fdd:fdd,itb:itb,wireless:wireless},

  function(data) { location.reload();
	
	 });
	}
	
	})
		 
		 
		 
		 </script>
		 
